home *** CD-ROM | disk | FTP | other *** search
/ Aminet 45 / Aminet 45 (2001)(GTI - Schatztruhe)[!][Oct 2001].iso / Aminet / game / role / ldmud-3.2-bin.lha / mud / doc / efun / notify_fail < prev    next >
Text File  |  2001-04-06  |  1KB  |  39 lines

  1. SYNOPSIS
  2.         int notify_fail(string str)
  3.         int notify_fail(closure cl)
  4.  
  5. DESCRIPTION
  6.         Store str as the error message given instead of the default
  7.         message ``What ?''. The result is always 0.
  8.         
  9.         If a closure is given, it is executed to return the error
  10.         message string, but not before all attempts to execute the
  11.         commandline failed (read: not at the time of the call to
  12.         notify_fail()). The closure receives as argument the original
  13.         commandgiver; usually it is identical to this_player(), unless
  14.         the modify_cmd hook changed that.
  15.         
  16.         If notify_fail() is called more than once for this command, only the
  17.         last call will be used. However, calls to notify_fail() in nested
  18.         commands have no effect on this command.
  19.         
  20.         The idea of this function is to give better error messages
  21.         instead of simply 'What ?'.
  22.         
  23.         It is also better to use
  24.                 return notify_fail(message);
  25.         instead of
  26.                 write(message); return 1;
  27.         
  28.         Other objects will get the chance to evaluate the verb.
  29.  
  30. HISTORY
  31.         Returntype changed in LDMud 3.2.6 from void to int.
  32.         Since LDMud 3.2.7, notify-fail settings are saved over nested
  33.         commands, and NPCs can see their notify-fail messages.
  34.  
  35.  
  36. SEE ALSO
  37.         add_action(E), query_verb(E), query_command(E), query_notify_fail(E),
  38.         hooks(C)
  39.